/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.migracion.pool;

import org.antlr.stringtemplate.StringTemplate;

/**
 *
 * @author stevenziggiz
 */
public class MSSQL extends DriverConnectionPool implements DataBaseConnection{

    private MSSQL() {
        setTablesList("Select * FROM all_tables Where OWNER = "+this.getDataBaseName()+";");
        setColumnsList("Show COLUMNS IN $TABLE_PARAM$ FROM "+this.getDataBaseName()+";");
    }
    
    public MSSQL(String ipServer, int port, String dataBaseName, String user, String password) {
        DRIVER_NAME = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
        URL = new StringTemplate("jdbc:microsoft:sqlserver://$HOST$:$PORT$;DatabaseName=$DATABASE$");
        //Cambia las variables definidas en el Template por los valores correspondientes
        URL.setAttribute("HOST", ipServer);
        URL.setAttribute("PORT", port);
        URL.setAttribute("DATABASE", dataBaseName);
        this.user = user;
        this.password = password;
        this.setDataBaseName(dataBaseName);
    }
    
}
